package design2.prototype.example.cloneable;

/**
 * java Cloneable 接口
 */
public class Demo {
	public static void main(String[] args) throws CloneNotSupportedException {
		User user1=new User("AAA","12","上海");
		User user2=(User) user1.clone();

		if(user1!=user2){
			System.out.println("它们是两个不同对象！");
			if(user1.equals(user2)){
				System.out.println("它们是一样的！");
			}
		}else{
			System.out.println("它们是两个相同对象！");
		}

		System.out.println(user1.toString());
		System.out.println(user2.toString());

	}
}
